package com.uqpsoftware.uqplist.tabs;

import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;

public class RelayClickInfoToFragmentListener implements
		OnCheckedChangeListener, OnClickListener, OnLongClickListener {
	private final int mTaskID;
	private final ListData mListData;

	public RelayClickInfoToFragmentListener(int id, ListData listData) {
		mTaskID = id;
		mListData = listData;
	}

	@Override
	public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
		mListData.setCompletedStatusOfTask(mTaskID);

	}

	@Override
	public void onClick(View arg0) {
		mListData.setCompletedStatusOfTask(mTaskID);

	}

	@Override
	public boolean onLongClick(View arg0) {
		mListData.longPress(mTaskID);
		return false;
	}

}